<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>用户中心</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="">
  <meta name="description" content="">
  {include file="public/css"}
</head>
<body>

<!-- 头部开始 -->
{include file="public/header"}
<!-- 头部结束 -->


<div class="layui-main fly-marginTop fly-user-main ">

<div class="user-left-menu" style=""> 

<!-- 用户中心导航菜单 -->
{include file="public/left_menu"}
</div>
        <div class="fly-panel fly-panel-user user-right-content" pad20>

        <div class="layui-tab layui-tab-brief" lay-filter="user">

          <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
              <li class="layui-this">所有信息</li>
            </ul>
          </div>  

            <div class="layui-tab-content" style="padding: 20px 0;">
            <!-- 筛选 -->
            <form class="layui-form" action="" method="post">
               <div class="layui-form-item">
                   <label class="layui-form-label" style="width:60px;">标题</label>
                  <div class="layui-input-inline" style="width:250px;">
                    <input type="text" name="keywords" placeholder="请输入交易标题" autocomplete="off" class="layui-input"  value="{$Request.param.keywords}">
                  </div>
                 <label class="layui-form-label" style="width:60px;">状态</label>
                <div class="layui-input-inline" style="width:100px;">
                  <select name="status" >
                    <option value=""  {if $Request.param.status == ''} selected {/if}>全部</option>
                    <option value="1" {if $Request.param.status == '1'} selected {/if}>待审核</option>
                    <option value="2" {if $Request.param.status == '2'} selected {/if}>已发布</option>
                    <option value="3" {if $Request.param.status == '3'} selected {/if}>交易中</option>
                    <option value="4" {if $Request.param.status == '4'} selected {/if}>交易完成</option>
                    <option value="5" {if $Request.param.status == '5'} selected {/if}>交易失败</option>
                  </select>
               </div>

                    <div class="layui-input-inline" style="width:100px;">
                      <button class="layui-btn layui-btn-normal" lay-submit lay-filter="form">搜 索</button>
                
                    </div>
              </div>
              </form>
           </div>

                   <!-- 表格内容 -->
                   <table class="layui-table " lay-even lay-skin="line" >
                    <colgroup>
                      <col width="300">
                      <col width="100">
                      <col width="200">
                      <col width="100">
                      <col width="100">
                      <col width="200">
                     
                    </colgroup>
                    <thead>
                      <tr>
                        <th>标题</th>
                        <th>预算价格</th>
                        <th>发布用户</th>
                        <th>发布时间</th>
                        <th>状态</th>
                        <th>操作</th>
                      </tr> 
                    </thead>
                    <tbody>
                   {volist name="list" id="vo"}  
         
                      <tr>
                        <td><a href="{:url('@guarantee/trade/detail',['id'=>$vo.id])}">{$vo.title}</a></td>
                        <td><p class="orange">￥{$vo.price}  </p>
                       </td>
                        <td> <p>{$vo.username}</p> </td>
                        <td>{$vo.create_time|date="Y-m-d"}</td>
                        <td>{if  $vo.status ==0 }待审核{elseif $vo.status ==1}已发布{elseif $vo.status ==2}交易中{elseif $vo.status ==3}交易完成{elseif $vo.status ==-1}审核失败{/if}</td>
                        
                        <td>
                            {if  $vo.status ==0 } 
                            <a href="{:url('guarantee/infoEdit',['id'=>$vo.id])}" class="edit" >编辑</a>
                            {/if}
                          {if  $vo.status <=1 } 
                 
                            <a href="javascript:;" class="del" data-id="{$vo.id}">删除</a>
                          {/if}</td>
                      </tr>
                   
              
                   {/volist}
                  </tbody>
                </table>  
                          
                      <div id="pages">{$page|raw}</div>

           </div>
           </div>
        </div>
        </div>
    
</div>
{include file="public/js"}
<!-- 会员底部文件 -->
{include file="public/footer"}



<script>

layui.use(['form'], function(){
  var form = layui.form;


});
</script>

<script>
$(function(){
  $(".del").on('click',function(){
    var id = $(this).attr('data-id');
    $.post('{:url("guarantee/infoDel")}',{id:id},function(json){
       if(json.code == 0){
           layer.msg(json.msg);  
           location.reload();
       }else{
           layer.msg(json.msg);
       }
    });
  });
});
</script>
</body>
</html>